#include<stdio.h>
#include<string.h>
#include<unistd.h>

#define M 101
#define ST '#'

int main()
{
  char arr[M];
  memset(arr,0,sizeof(arr));
  const char* ptr = "/|\\-";
  int len = strlen(ptr);
  int cut=0;
  while(cut<=100)
  {
    printf("[%-100s]%d%[%c]\r",arr,cut,ptr[cut%len]);
    fflush(stdout);
    arr[cut]=ST;
    sleep(1);
    cut++;
  }
  printf("\n");
  return 0;
}
